import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    redirect: 'about/Shang',  // 重定向:重新指向其它path,会改变网址:'/Shang',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue'),
    children: [
      {
        path:'Shang',
        component:()=>import('../views/Shang.vue')
      },
      {
        path: 'fenlie',
        component: () => import('../views/Fenlie.vue')
      },
      {
        path: 'Gowu',
        component: () => import('../views/Gowu.vue')
      }, {
        path: 'Geren',
        component: () => import('../views/Geren.vue')
      }
    ]
  }, {
    path: '/tel',
    component: () => import('../views/Tel.vue')
  },{
    path:'/xiang',
    component:()=>import('../views/Xiang.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
